import { Column, Entity, ManyToOne } from 'typeorm'
import { DiscordID } from '@boticord/common'
import { User } from '@boticord/users-client'
import { ResourceComment } from '@boticord/resources-client/models/comment.model'

export enum ResourceReportStatus {
  Pending,
  Approved,
  Denied
}

@Entity()
export class Report extends DiscordID {
  @ManyToOne(() => ResourceComment, r => r.reports)
  declare resource: ResourceComment

  @ManyToOne(() => User, u => u.reports)
  declare from: User

  @Column()
  declare content: string

  @Column({ type: 'bigint' })
  declare createdAt: number

  @Column({
    type: 'enum',
    enum: ResourceReportStatus,
    default: ResourceReportStatus.Pending,
  })
  declare status: ResourceReportStatus
}
